package com.wsp.apimanagement.pojo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * Package: com.wsp.service.pojo.entity
 * Description： TODO
 *
 * @Author: 巫思平
 * Copyright: Copyright (c) 2020
 * Version: 1
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "评论")
public class Comment {

    @ApiModelProperty("评论id")
    private long commentId;

    @NotNull(message = "父评论id不能为空")
    @ApiModelProperty("父评论id")
    private long pid;

    @ApiModelProperty("被恢复人用户名")
    private String repliedUserName;

    @NotNull(message = "圈子id不能为空")
    @ApiModelProperty("圈子id")
    private long recordId;

    @NotNull(message = "用户id不能为空")
    @ApiModelProperty("用户id")
    private long userId;

    @NotBlank(message = "内容不能为空")
    @Size(max = 100)
    @ApiModelProperty("评论内容")
    private String content;

    @ApiModelProperty("评论发表时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime gmtCreate;

}
